package com.ijunfu.detail.thread._01_Thread;

import lombok.extern.slf4j.Slf4j;

import java.util.stream.IntStream;

/**
 *
 * @Title  : 
 * @Author : ijunfu <ijunfu@163.com>
 * @Date   : 2023/11/23 16:39
 * @Version: 1.0
 * @Motto  : 世界很大 世界很小
 *
 */
@Slf4j
public class _08Main {

    public static void main(String[] args) {

        Thread t1 = new Thread(()->{
            IntStream.range(0,10).forEach(idx->{
                log.info("{}", idx);
            });
        });

        Thread t2 = new Thread(()->{
            IntStream.range(0,10).forEach(idx->{
                log.info("{}", idx);
            });
        });

        // 设置线程优先级
        t1.setPriority(Thread.MAX_PRIORITY);
        t2.setPriority(Thread.NORM_PRIORITY);

        t1.start();
        t2.start();
    }
}
